<%@page import="cn.yunhe.entity.Cate"%>
<%@page import="cn.yunhe.biz.CateBiz"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'cateList.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<style>
	td{
		text-align: center;
	}
</style>
</head>

<body background="pic/ManBgroud.gif">
	添加新主题：<br/>    	
    	<form action="CateServlet" method="post">
    		主题类别：<input type="text" name="catename" size="20">
    		<input type="submit" value="添加">
    	</form>
	<table style="width: 80%; border: 1px solid #006666">
		<tr>
			<th>主题编号</th>
			<th>主题类别</th>
			<th>操作</th>
		</tr>

		<%
			CateBiz cateBiz = new CateBiz();
			List<Cate> cates = cateBiz.getAllCate();

			for (int i = 0; i < cates.size(); i++) {
				Cate c = cates.get(i);
		%>
		<tr>
			<td><%=c.getCateId()%></td>
			<td><%=c.getCateName()%></td>
			<td><a href="admin/editCate.jsp?cateId=<%=c.getCateId()%>">编辑</a>|<a href="admin/deleteByCateId.jsp?cateId=<%=c.getCateId()%>">删除</a></td>
			
		</tr>

		<%
			}
		%>


	</table>

</body>
</html>
